home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
p_man
/
cat3
/
Xm
/
XmGetSecondaryResourceData.z
/
XmGetSecondaryResourceData
Wrap
Text File
|
1998-10-30
|
8KB
|
133 lines
XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa((((UUUU3333NNNNXXXXIIII))))XXXX SSSSyyyysssstttteeeeXXXXmmmmmmmmGGGGVVVVeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa((((3333XXXX))))
NNNNAAAAMMMMEEEE
XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa - A function that provides access
to secondary widget resource data
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
#include <Xm/Xm.h>
CCCCaaaarrrrddddiiiinnnnaaaallll XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa(
WWWWiiiiddddggggeeeettttCCCCllllaaaassssssss wwwwiiiiddddggggeeeetttt____ccccllllaaaassssssss,
XXXXmmmmSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa ********sssseeeeccccoooonnnnddddaaaarrrryyyy____ddddaaaattttaaaa____rrrreeeettttuuuurrrrnnnn);
VVVVEEEERRRRSSSSIIIIOOOONNNN
This page documents Motif 2.1.
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
Some Motif widget classes (such as Gadget, Text, and
VendorShell) have resources that are not accessible through
the functions XXXXttttGGGGeeeettttRRRReeeessssoooouuuurrrrcccceeeeLLLLiiiisssstttt and
XXXXttttGGGGeeeettttCCCCoooonnnnssssttttrrrraaaaiiiinnnnttttRRRReeeessssoooouuuurrrrcccceeeeLLLLiiiisssstttt. In order to retrieve the
descriptions of these resources, an application must use
XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa.
When a widget class has such resources, this function
provides descriptions of the resources in one or more data
structures. XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa takes a widget class
argument and returns the number of these data structures
associated with the widget class. If the return value is
greater than 0 (zero), the function allocates and fills an
array of pointers to the corresponding data structures. It
returns this array at the address that is the value of the
_s_e_c_o_n_d_a_r_y__d_a_t_a__r_e_t_u_r_n argument.
The type XXXXmmmmSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa is a pointer to a structure
with two members that are useful to an application:
_r_e_s_o_u_r_c_e_s, of type _X_t_R_e_s_o_u_r_c_e_L_i_s_t, and nnnnuuuummmm____rrrreeeessssoooouuuurrrrcccceeeessss, of
type CCCCaaaarrrrddddiiiinnnnaaaallll. The _r_e_s_o_u_r_c_e_s member is a list of the widget
resources that are not accessible using Xt functions. The
nnnnuuuummmm____rrrreeeessssoooouuuurrrrcccceeeessss member is the length of the _r_e_s_o_u_r_c_e_slist.
If the return value is greater than 0 (zero),
XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaaallocates memory that the
application must free. Use XXXXttttFFFFrrrreeeeeeee to free the resource list
in each structure (the value of the _r_e_s_o_u_r_c_e_s member), the
structures themselves, and the array of pointers to the
structures (the array whose address is
_s_e_c_o_n_d_a_r_y__d_a_t_a__r_e_t_u_r_n).
_w_i_d_g_e_t__c_l_a_s_s
Specifies the widget class for which secondary
resource data is to be retrieved.
_s_e_c_o_n_d_a_r_y__d_a_t_a__r_e_t_u_r_n
Specifies a pointer to an array of
Page 1 (printed 10/24/98)
XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa((((UUUU3333NNNNXXXXIIII))))XXXX SSSSyyyysssstttteeeeXXXXmmmmmmmmGGGGVVVVeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa((((3333XXXX))))
XXXXmmmmSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaapointers to be returned by
this function. If the widget class has no
secondary resource data, for example, if the value
returned by the function is 0 (zero), the function
returns no meaningful value for this argument.
RRRREEEETTTTUUUURRRRNNNN
Returns the number of secondary resource data structures
associated with this widget class.
EEEEXXXXAAAAMMMMPPPPLLLLEEEE
The following example uses XXXXmmmmGGGGeeeettttSSSSeeeeccccoooonnnnddddaaaarrrryyyyRRRReeeessssoooouuuurrrrcccceeeeDDDDaaaattttaaaa to
print the names of the secondary resources of the Motif Text
widget and then frees the data allocated by the function:
XmSecondaryResourceData * block_array;
Cardinal num_blocks, i, j;
if (num_blocks = XmGetSecondaryResourceData (xmTextWidgetClass,
&block_array)) {
for (i = 0; i < num_blocks; i++) {
for (j = 0; j < block_array[i]->num_resources; j++) {
printf("%s\n", block_array[i]->resources[j].resource_name);
}
XtFree((char*)block_array[i]->resources);
XtFree((char*)block_array[i]);
}
XtFree((char*)block_array);
}
Page 2 (printed 10/24/98)